cmake_minimum_required(VERSION 3.4.1)
#将libs的路径设置到变量中
set(lib_dir ${CMAKE_SOURCE_DIR}/../../../libs)

#include头文件
include_directories(${CMAKE_SOURCE_DIR}/../../../libs/include)

#引入rtmp的静态库
add_subdirectory(${CMAKE_SOURCE_DIR}/librtmp)

#x264
add_library(
        x264
        STATIC
        IMPORTED)

SET_TARGET_PROPERTIES(
        x264
        PROPERTIES IMPORTED_LOCATION
        ${lib_dir}/lib/libx264.a)

#faac
add_library(
        faac
        STATIC
        IMPORTED)

SET_TARGET_PROPERTIES(
        faac
        PROPERTIES IMPORTED_LOCATION
        ${lib_dir}/lib/libfaac.a)

add_library(
        native-lib

        SHARED

        native-lib.cpp)

find_library(
        log-lib

        log)


target_link_libraries(
        native-lib
        x264
        faac
        rtmp
        ${log-lib})